//
//  UIView+SheerFrame.h
//  SheerKrystal1
//
//  Created by 李雪 on 16/1/20.
//  Copyright © 2016年 「ゆき」. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface UIView (SheerFrame)

@property (nonatomic) CGFloat left;       // 左

@property (nonatomic) CGFloat top;        // 上

@property (nonatomic) CGFloat right;      // 右

@property (nonatomic) CGFloat bottom;     // 下


@property (nonatomic) CGFloat width;      // 宽

@property (nonatomic) CGFloat height;     // 高


@property (nonatomic) CGFloat centerX;    // 中心X

@property (nonatomic) CGFloat centerY;    // 中心Y


@property (nonatomic, readonly) CGFloat screenX;    // 屏幕尺寸 X

@property (nonatomic, readonly) CGFloat screenY;    // 屏幕尺寸 Y

@property(nonatomic,readonly) CGFloat screenViewX;

@property(nonatomic,readonly) CGFloat screenViewY;

@property(nonatomic,readonly) CGRect screenFrame;


@property(nonatomic) CGPoint origin;

@property(nonatomic) CGSize size;

@property(nonatomic) BOOL visible;

// 子类
- (UIView*)descendantOrSelfWithClass:(Class)cls;

// 父类
- (UIView*)ancestorOrSelfWithClass:(Class)cls;

// 删除所有子视图
- (void)removeAllSubviews;


// 计算偏移量 视图在另一个视图的屏幕坐标
- (CGPoint)offsetFromView:(UIView*)otherView;


// 视图控制器的视图
- (UIViewController*)viewController;


- (void)addSubviews:(NSArray *)views;


@end
